﻿
<div class="assoc-cl-top">
    <img src="" id="logo" style="
    width: 100%;
    height: 100%;
" />
</div>
<div class="assoc-cl-bottom">
    <div class="assoc-clb-item">
        <h1 id="navInfo">社团信息</h1>
        <a id="navbtnInfo" href="/personal/associate/commuityInfo.html" class="active" name="commuityInfo">社团信息</a>
        <a href="javascript:void(0)" name="account" class="unComplate">账户状态</a>
    </div>
    <div class="assoc-clb-item">
        <h1 id="h1Task">赞助筹备</h1>
        <span id="spanSupport"><a href="/my/support.html" name="support" id="navSupport">我的筹备</a></span>
        <a href="/my/invite.html" name="invite" id="navInvite">我的邀请</a>
        <a href="/my/contract.html" name="contract" id="navContract">我的合同</a>
        <a href="/my/sponsor.html" name="sponsor" id="navSponsor">我的收藏</a>
    </div>
    <div class="assoc-clb-item">
        <h1>消息</h1>
        <a href="/my/systemNotice.html" name="systemNotice" id="navNotice">系统通知</a>
        <a href="javascript:void(0)" class="unComplate">查看私信</a>
    </div>
    <div class="assoc-clb-item">
        <h1>账户中心</h1>
        <a id="navbtnCharge" href="/personal/associate/inCharge.html" name="inCharge">负责人信息</a>
        <a href="javascript:void(0)" name="accountIn" class="unComplate">账号绑定</a>
        <a href="javascript:void(0)" name="number" class="unComplate">收款账号</a>
        <a id="btnPwd" href="/my/revisePwd.html" name="revisePwd">修改密码</a>
    </div>
</div>
<script>
    $(document).ready(function () {
        var userType = common.GetUserType();
        var logo = common.GetUserLogo();
        var navUrl = location.pathname;
        $("#logo").attr("src", logo);

        //function Init(userType) {
        if (userType == 1) {
            $("#navInfo").html("企业信息");
            $("#navbtnInfo").html("企业信息");
            $("#navSupport").html("我的赞助");
            $("#navbtnInfo").attr("href", "/company/company/companyInfo.html");
            $("#navbtnCharge").attr("href", "/company/company/inCharge.html");
            $("#btnPwd").attr("href", "/my/revisePwd.html");
        }
        else if (userType == 3) {
            $("#navInfo").html("代理官信息");
            $("#h1Task").html("任务中心");
            $("#navbtnInfo").html("代理官信息");
            $("#navbtnInfo").attr("href", "/agent/agent/commuityInfo.html");
            $("#btnPwd").attr("href", "/my/revisePwd.html");

            $("#spanSupport").hide();
            $("#navbtnCharge").hide();
        }
        $("#divNavigation").find("a").removeClass('active');

        if (navUrl.indexOf("companyInfo.html") != -1 || navUrl.indexOf("commuityInfo.html") != -1) {
            $("#navbtnInfo").addClass('active');

        }
        else if (navUrl.indexOf("invite.html") != -1) {
            $("#navInvite").addClass('active');
        }
        else if (navUrl.indexOf("contract.html") != -1) {
            $("#navContract").addClass('active');
        }
        else if (navUrl.indexOf("sponsor.html") != -1) {
            $("#navSponsor").addClass('active');
        }
        else if (navUrl.indexOf("inCharge.html") != -1) {
            $("#navbtnCharge").addClass('active');
        }
        else if (navUrl.indexOf("revisePwd.html") != -1) {
            $("#btnPwd").addClass('active');
        }
        else if (navUrl.indexOf("systemNotice.html") != -1) {
            $("#navNotice").addClass('active');
        }
        else if (navUrl.indexOf("support.html") != -1) {
            $("#navSupport").addClass('active');
        }
        else {
            $("#navbtnInfo").addClass('active');
        }
    });
    $(".assoc-clb-item a").on("click", function (e) {
        var self = $(this);
        var nameVal = self.attr('name');
        self.parent().siblings().find('a').removeClass('active');
        self.siblings().removeClass('active');
        self.addClass('active');
        //if (common.checkValue($("#assocRight")[0]))
        //    $("#assocRight").load("./associate/" + nameVal + ".html");
    });
    $(".unComplate").on("click", function (e) {
        var self = $(this);
        var nameVal = self.attr('name');
        self.parent().siblings().find('a').removeClass('active');
        self.siblings().removeClass('active');
        self.addClass('active');
        common.alertMessage("您好，目前该功能正在开发中，敬请期待");
        //if (common.checkValue($("#assocRight")[0]))
        //    $("#assocRight").load("./associate/" + nameVal + ".html");
    });
</script>